package com.qf.pojo;

import org.apache.ibatis.type.Alias;

import java.util.Date;

/**
 * @Author:zhangyang
 * @Date: 11:09
 * @Version 1.0
 *
 * mybatis:关系型映射框架
 *
 * 实体类的属性和表中的字段对应上
 * User                                               user表
 * 实体类的属性小写:符号小驼峰命名
 *  username                                        user_name
 *  NAME (必须小写,否则获取到name)                  NAME
 */
public class User {

    //提供一些属性
    /**
     * id` int(11) NOT NULL AUTO_INCREMENT,
     *   `username` varchar(32) DEFAULT NULL,
     *   `birthday` datetime DEFAULT NULL,
     *   `sex` varchar(2) DEFAULT NULL,
     *   `address` varchar(256) DEFAULT NULL,
     */

    /**
     * 如果实体类中的属性和表中的字段列名不对应,查询用户的所有数据,是否能够查询出来?
     */
    private Integer userId ;
    private String userName ;
    private Date userBirthday ;
    private String userSex ;
    private String userAddress ;

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Date getUserBirthday() {
        return userBirthday;
    }

    public void setUserBirthday(Date userBirthday) {
        this.userBirthday = userBirthday;
    }

    public String getUserSex() {
        return userSex;
    }

    public void setUserSex(String userSex) {
        this.userSex = userSex;
    }

    public String getUserAddress() {
        return userAddress;
    }

    public void setUserAddress(String userAddress) {
        this.userAddress = userAddress;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", userName='" + userName + '\'' +
                ", userBirthday=" + userBirthday +
                ", userSex='" + userSex + '\'' +
                ", userAddress='" + userAddress + '\'' +
                '}';
    }

    //以前实体的属性和数据库表中的列名对应
    /* private Integer id ; //编号
    private String username ; //用户名
    private Date birthday;
    private String sex ;
    private String address ;//地址


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", birthday=" + birthday +
                ", sex='" + sex + '\'' +
                ", address='" + address + '\'' +
                '}';
    }*/
}
